const { DataTypes } = require('sequelize');
const { sequelize } = require('../init'); // 导入数据库连接配置
const { Employee } = require('./Employee');
// 任务分派表
const TaskAssignment = sequelize.define('TaskAssignment', {
    AssignmentID: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
    },
    WorkOrderID: {
        type: DataTypes.INTEGER,
        allowNull: false,
    },
    AssignedToUserID: {
        type: DataTypes.INTEGER,
        allowNull: true,
    }
}, {
    tableName: 'taskAssignment', // 显式指定表名为 "user"
    timestamps: false, // 如果表中不包含 createdAt 和 updatedAt 字段，请将此选项设置为 false
    collate: 'utf8mb4_bin' // 设置字符集规则
});
// 帮我打印一下数据库连接情况
TaskAssignment.sync({ force: false }).then(() =>
{
    console.log('任务分配表准备');
});

module.exports = { TaskAssignment };